package utl.mofen.json;

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import com.google.gson.JsonObject;

public class ConvertUtil {
	public static void rsRecord2JsonObject(ResultSet rs, JsonObject json)
	{
		try {
			ResultSetMetaData rsmd = rs.getMetaData();
			for (int i = 1; i <= rsmd.getColumnCount(); i++) {
				
				json.addProperty(rsmd.getColumnName(i).toLowerCase(), rs.getString(i));
			};
		} catch (SQLException e) {			
			e.printStackTrace();
		}	
	}
}
